<?php if ($reviews) { ?>
<?php foreach ($reviews as $review) { ?>
<table class="table table-striped table-bordered">
  <tr>
    <td style="width: 50%;"><strong><?php echo $review['author']; ?></strong></td>
    <td class="text-right"><?php echo $review['date_added']; ?></td>
  </tr>
  <tr>
    <td colspan="2">
      <div class="oreview-img-box">
        <?php foreach ($review['images'] as $image) { ?>
        <a href="<?php echo $image ?>" class="oreview-fancybox" rel="group"><img src="<?php echo $image ?>" class="img-responsive" ></a>
        <?php } ?>
      <div>
      <p><?php echo $review['text']; ?></p>
      <div class="rating stars-box">
        <?php for ($i = 1; $i <= 5; $i++) { ?>
        <?php if ($review['rating'] < $i) { ?>
        <span class="fa fa-stack"><i class="fa fa-star off fa-stack-1x"></i></span>
        <?php } else { ?>
        <span class="fa fa-stack"><i class="fa fa-star off fa-stack-1x"></i><i class="fa fa-star fa-stack-1x"></i></span>
        <?php } ?>
        <?php } ?>
      </div>
  </tr>
</table>
<?php } ?>
<div class="text-right"><?php echo $pagination; ?></div>
<?php } else { ?>
<p><?php echo $text_no_reviews; ?></p>
<?php } ?>

<script type="text/javascript">
  $(document).ready(function() {
    $(".oreview-fancybox").fancybox({
      prevEffect: 'none',
      nextEffect: 'none',
      closeBtn: false,
      helpers: {
        title: { type : 'inside' },
        buttons: {}
      }
    });
  });
</script>